package com.vrp3d.domain.dto.user;

import com.vrp3d.common.consts.CommonConst;
import com.vrp3d.domain.validator.Mobile;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 用户注册dto
 *
 * @author vrp3d
 */
@Data
public class UserForRegisteredDTO implements Serializable {
    private static final long serialVersionUID = 4302184353432347371L;

    @ApiModelProperty(value = "手机号", required = true)
    @Mobile
    private String mobile;

    @ApiModelProperty(value = "密码", required = true)
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = CommonConst.PASSWORD_REGULAR, message = "密码不符合规范")
    private String password;

    @ApiModelProperty(value = "验证码", required = true)
    @NotBlank(message = "验证码不能为空")
    @Pattern(regexp = CommonConst.VERIFICATION_CODE, message = "验证码不正确")
    private String captcha;
}
